import java.util.*;

public class FCFS extends DiskScheduler
{
    LinkedList<Request> queue = new LinkedList<Request>();
    Request target;
    public FCFS(HardDisk hd)
    {
        super(hd);
    }
    
    public void addRequest(Request r)
    {
        queue.addLast(r);
    }
    
    public void removeRequest(Request r)
    {
        queue.remove(r);
        System.out.println(queue);
    }
    
    public void tick()
    {
        target = queue.peekFirst();
        if(target!=null)
        {
            hardDisk.targetTrack = target.track;
            hardDisk.targetSector = target.sector;
        }
        else
        {
            hardDisk.targetTrack = -1;
            hardDisk.targetSector = -1;    
        }
    }
        
}